# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3OcrConfig do
  @moduledoc """
  Config for Document OCR.

  ## Attributes

  *   `advancedOcrOptions` (*type:* `list(String.t)`, *default:* `nil`) - A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are: - `legacy_layout`: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.
  *   `computeStyleInfo` (*type:* `boolean()`, *default:* `nil`) - Turn on font identification model and return font style information. Deprecated, use PremiumFeatures.compute_style_info instead.
  *   `disableCharacterBoxesDetection` (*type:* `boolean()`, *default:* `nil`) - Turn off character box detector in OCR engine. Character box detection is enabled by default in OCR 2.0 (and later) processors.
  *   `enableImageQualityScores` (*type:* `boolean()`, *default:* `nil`) - Enables intelligent document quality scores after OCR. Can help with diagnosing why OCR responses are of poor quality for a given input. Adds additional latency comparable to regular OCR to the process call.
  *   `enableNativePdfParsing` (*type:* `boolean()`, *default:* `nil`) - Enables special handling for PDFs with existing text information. Results in better text extraction quality in such PDF inputs.
  *   `enableSymbol` (*type:* `boolean()`, *default:* `nil`) - Includes symbol level OCR information if set to true.
  *   `hints` (*type:* `GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3OcrConfigHints.t`, *default:* `nil`) - Hints for the OCR model.
  *   `premiumFeatures` (*type:* `GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3OcrConfigPremiumFeatures.t`, *default:* `nil`) - Configurations for premium OCR features.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :advancedOcrOptions => list(String.t()) | nil,
          :computeStyleInfo => boolean() | nil,
          :disableCharacterBoxesDetection => boolean() | nil,
          :enableImageQualityScores => boolean() | nil,
          :enableNativePdfParsing => boolean() | nil,
          :enableSymbol => boolean() | nil,
          :hints =>
            GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3OcrConfigHints.t()
            | nil,
          :premiumFeatures =>
            GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3OcrConfigPremiumFeatures.t()
            | nil
        }

  field(:advancedOcrOptions, type: :list)
  field(:computeStyleInfo)
  field(:disableCharacterBoxesDetection)
  field(:enableImageQualityScores)
  field(:enableNativePdfParsing)
  field(:enableSymbol)
  field(:hints, as: GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3OcrConfigHints)

  field(:premiumFeatures,
    as: GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3OcrConfigPremiumFeatures
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3OcrConfig do
  def decode(value, options) do
    GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3OcrConfig.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3OcrConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
